import {
	Http
} from '../utils/request.js'

class orderIndex extends Http {
   //订单列表
    apiOrderList(data){
      return this.request({
        url: '/order-list',
        method: 'post',
        data,
        loading: true
      })
    }
    //订单详情
    apiOrderInfo(data){
      return this.request({
        url: '/order-info',
        method: 'post',
        data,
        loading: true
      })
    }
  //取消订单
  apiCancelOrder(data){
    return this.request({
      url: '/cancel-order',
      method: 'post',
      data,
      loading: true
    })
  }
  //查询运费
  apiDeliveryFee(data){
    return this.request({
      url: '/get-delivery-fee',
      method: 'post',
      header:{
        'Content-Type':'application/json'
      },
      data,
      loading: true
    })
  }
  //再来一单
  apiOneMoreOrder(data){
    return this.request({
      url: '/one-more-order',
      method: 'post',
      data,
      loading: true
    })
  }
  //提交订单
  apiSubmiOrder(data){
    return this.request({
      url: '/submit-order',
      method: 'post',
      header:{
        'Content-Type':'application/json'
      },
      data,
      loading: true
    })
  }
  //提交支付
  apiSubmiPay(data){
    return this.request({
      url: '/submit-pay',
      method: 'post',
      data,
      loading: true
    })
  }
  //查询可用优惠券
  apiUsefulCoupon(data){
    return this.request({
      url: '/useful-coupon',
      method: 'post',
      data,
      loading: true
    })
  }
  //查询付款结果
  apiGetPayResult(data){
    return this.request({
      url: '/get-pay-result',
      method: 'post',
      data,
      loading: true
    })
  }
  //确认收货
  apiConfirmReceipt(data){
    return this.request({
      url: '/confirm-receipt',
      method: 'post',
      data,
      loading: true
    })
  }

  //售后单列表
  apiQuestionorderList(data){
    return this.request({
      url: '/questionorder/list',
      method: 'post',
      data,
      loading: true
    })
  }
  //详情
  apiQuestionorderInfo(data){
    return this.request({
      url: `/questionorder/info/${data.id}`,
      method: 'post',
      data,
      loading: true
    })
  }
  //提交售后单
  apiQuestionorderSubmit(data){
    return this.request({
      url: `/questionorder/submit`,
      method: 'post',
      data,
      loading: true
    })
  }
  // 开票信息 
  apiInvoiceInfo(data){
    return this.request({
      url: `/invoice-info`,
      method: 'post',
      data,
      loading: true
    })
  }
  // 申请开票 
  apiApplyInvoice(data){
    return this.request({
      url: `/apply-invoice`,
      method: 'post',
      data,
      loading: true
    })
  }
  // 代付订单详情 
  apiAgentOrderInfo(data){
    return this.request({
      url: `/agent-order-info`,
      method: 'post',
      data,
      loading: true
    })
  }
  // 代付
  apiAgentPay(data){
    return this.request({
      url: `/agent-pay`,
      method: 'post',
      data,
      loading: true
    })
  }
}
export default new orderIndex()